#!/bin/bash

echo "DIRs"
find ./src -type d  | wc -l
echo "FILEs"
find ./src -type f  | wc -l
echo "LINEs"
find ./src -name "*.go" |xargs cat|grep -v ^$|wc -l
echo "DETAILs"
find ./src -type f -name "*.go" | xargs wc -l | sort -n

dirs=`find ./src -type d |xargs`
for dir in $dirs; do
    echo ${dir}
    gofmt -tabwidth=4 -tabs=false -w=true ${dir}/*.go
done


rm -f ./bin/lesskeeper

go build -ldflags "-w -s" -o ./bin/lesskeeper ./src/main.go ./src/proposer.go ./src/acceptor.go ./src/cmdaction.go ./src/jtloc.go ./src/version.go

prefix=`pwd`
./bin/lesskeeper --prefix=${prefix}

